# Makefile for libcalc.a

libcalc.a: add.o sub.o
	@ar -rc $@ $^
	@echo "build $^ to $@ ... done"

%.o:%.c
	@gcc -c $<
	@echo "compiling $< to $@ ... done"

.PHONY:output
output:
	@mkdir -p calc_dist/include
	@mkdir -p calc_dist/lib
	@cp -f *.h calc_dist/include
	@cp -f *.a calc_dist/lib
	@tar -czf calc_dist.tgz calc_dist
	@echo "output calc_dist package ... done"

.PHONY:clean
clean:
	@rm -rf *.a *.o calc_dist*
	@echo "clean ... done"
